package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.SkillDao;
import com.platform.server.service.SkillService;

@Service
public class SkillServiceImpl implements SkillService {
	
	@Autowired
	private SkillDao skillDao;
	
	/**
	 * 技能列表
	 */
	@Override
	public List<Map<String, Object>> skillList(String id,String startTime,String endTime,String serverName,String content) {
		return skillDao.skillList(id,startTime,endTime,serverName,content);
	}

	/**
	 * 添加分类
	 */
	@Override
	public int insertServer(String server_name,String server_sub_name,String server_price,String detailed) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("server_name", server_name);
		map.put("server_sub_name", server_sub_name);
		map.put("server_price", server_price);
		map.put("detailed", detailed);
		return skillDao.insertServer(map);
	}

	/**
	 * 删除服务
	 */
	@Override
	public int deleteServer(String id) {
		return skillDao.deleteServer(id);
	}

	/**
	 * 修改服务
	 */
	@Override
	public int updateServer(String id, String server_sub_name, String server_name, String server_price,String detailed) {
		Map<String,Object> map = new HashMap<>();
		map.put("id", Integer.parseInt(id));
		map.put("server_sub_name", server_sub_name);
		map.put("server_name",server_name);
		map.put("server_price", server_price);
		map.put("detailed", detailed);
		return skillDao.updateServer(map);
	}

}
